﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_xzMessage : System.Web.UI.Page
{
    AccessDAO dao = new AccessDAO();
    protected void Page_Load(object sender, EventArgs e)
    {
        //IsAdmin.Admin();
        if (!Page.IsPostBack)
        {
            Session["xzId"] = "";
            show();
        }
    }

    private void show()
    {
        string sql = "select * from xzInfo";
        DataSet ds = dao.getDs(sql);
        this.GridView1.DataSource = ds;
        this.GridView1.DataBind();
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        show();
    }
    protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        string id = this.GridView1.DataKeys[e.NewSelectedIndex].Value.ToString();
        Session["xzId"] = id;
        Server.Transfer("xzMessage1.aspx");
    }
}
